package com.bosssoft.user.permission.center.serve.dao.mapper;

import com.bosssoft.user.permission.center.serve.dao.entity.RoleUser;
import com.bosssoft.user.permission.center.serve.pojo.vo.RoleUserVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleUserMapper {

    Boolean batchDeleteRolesWithUser(@Param("ids") List<Long> ids);

    Boolean batchAllocateUser(@Param("roleUserList") List<RoleUser> roleUserList);

    @Delete("DELETE FROM basic_user_role WHERE role_id = #{roleId}")
    void batchDeleteTheUsersOfRole(@Param("roleId") Long roleId);

    List<RoleUserVO> checkRoleUser(@Param("roleId") Long roleId, @Param("name") String name, @Param("companyId") Long companyId );

    void batchDeletePartRolesWithUser(@Param("roleId") Long roleId,@Param("currentPageUserIds") List<Long> currentPageUserIds);
}
